import sys

a = input()
b = int(a,16)
print(b)
